#ifndef REFERENCE_H
#define REFERENCE_H


#include "dtwentycore_global.h"
#include <modelitem.h>
#include <QPointer>


class DTWENTYCORESHARED_EXPORT Reference : public ModelItem
{
    Q_OBJECT

    Q_PROPERTY(QString referencePath READ referencePath WRITE setReferencePath NOTIFY referencePathChanged)

    QString m_referencePath;
    QPointer<ModelItem> m_referenceItem;


public:

    Q_INVOKABLE Reference(QObject *parent = 0);
    Reference(const Reference& other);

    QString referencePath() const;
    const ModelItem* referenceItem() const;

    QVariant data(const QString& name) const;



signals:

    void referencePathChanged(QString arg);
    void referenceItemChanged();


public slots:

    void setReferencePath(QString arg);
    void setReferenceItem(ModelItem* item);

    /// \brief Set additional data
    void setData(const QString& name, const QVariant& value);


protected slots:

    void refreshReference();


};


Q_DECLARE_METATYPE(Reference)


#endif // REFERENCE_H

